<script type="text/javascript">
	function doSearchCmsCotentPic(value) {
		
	}
	
	//表格查询  
	function reloadCmsCotentPic() {
		var params = cmsCotentPic_list.datagrid('options').queryParams; //先取得 datagrid 的查询参数  
		printLog(params);
		cmsCotentPic_list.datagrid('reload'); //设置好查询参数 reload 一下就可以了  
		cmsCotentPic_list.datagrid('unselectAll');
		cmsCotentPic_list.datagrid('uncheckAll');
	}


	function addCmsCotentPic() {
		createFromWindow("新增信息", "cmsCotentPic.do?editCmsCotentPic", "cmsCotentPic.do?saveCmsCotentPic",
				function(data) {
					reloadCmsCotentPic();
				});
	}
	
	function deleteCmsCotentPic() {
		var rows = cmsCotentPic_list.datagrid('getChecked');
	    if (rows&&rows.length>0){
	        $.messager.confirm('询问','你确认要删除吗?',function(r){
	            if (r){
	            	var ids = "";
	            	for(var i=0; i<rows.length; i++){
	            		ids += rows[i].id+",";
	            	}
	                $.post('cmsCotentPic.do?deleteCmsCotentPicItems',{ids:ids},function(result){
	                    if (result.success){
	                    	reloadCmsCotentPic();    
	                    }
	                    showMsg(result.msg);
	                },'json');
	            }
	        });
	    }else {
	    	showMsg("请选择操作记录.");
	    }
	}

	function editCmsCotentPic() {
		var rows = cmsCotentPic_list.datagrid('getChecked');
		printLog(rows);
		if (rows&&rows.length>0) {
			if(rows.length>1) {
				showMsg('请选择一条操作记录.');
				return;
			}
			createFromWindow("编辑信息", "cmsCotentPic.do?editCmsCotentPic&cmsCotentPicId=" + rows[0].id,
					"cmsCotentPic.do?saveCmsCotentPic", function(data) {
						reloadCmsCotentPic();
					},true);
		} else {
			showMsg('请选择操作记录.');
		}

	}
	
	
	function clearCmsCotentPicSearch() {
		setGridSearchParams('cmsCotentPic_list','cmsCotentPicSearchForm',true,reloadCmsCotentPic);
	}
	
	//根据条件查询
	function cmsCotentPicSearch() {
		setGridSearchParams('cmsCotentPic_list','cmsCotentPicSearchForm',false,reloadCmsCotentPic);
	}
	
	function onDblClickCmsCotentPicRow(rowIndex, rowData) {
		createFromWindow("编辑信息", "cmsCotentPic.do?editCmsCotentPic&cmsCotentPicId=" + rowData.id,
					"cmsCotentPic.do?saveCmsCotentPic", function(data) {
						reloadCmsCotentPic();
					},true);
	}
</script>


<div class="easyui-layout" data-options="fit:true">
	<div data-options="region:'center',border:false">
		<@eu.datagrid id="cmsCotentPic_list" toolbar="#cmsCotentPiclist_search" idField="id"  url="cmsCotentPic.do?loadList" rownumbers="true" onDblClickRow="onDblClickCmsCotentPicRow(rowIndex, rowData)"
			 item="com.xdtech.cms.vo.CmsCotentPicItem"/>
		
		<div id="cmsCotentPiclist_search">
			<div style="margin-bottom:5px;padding-left:5px;margin-top: 5px;">
				<form id="cmsCotentPicSearchForm">
					<!-- 防止form表单里只有一个text元素时候，按enter键自动提交问题 -->
					<input style="display:none" />
					<table>
						<tr>
						</tr>
					</table>
				</form>
				
			</div>
			<div id="cmsCotentPic_toolbar" style="height: auto">
				<@eu.linkbutton showName="新增" shiro="cms:cmsCotentPic:add" iconCls="icon-add" onclick="addCmsCotentPic()"/>
				<@eu.linkbutton showName="删除" shiro="cms:cmsCotentPic:delete" iconCls="icon-remove" onclick="deleteCmsCotentPic()"/>
				<@eu.linkbutton showName="编辑" shiro="cms:cmsCotentPic:edit" iconCls="icon-edit" onclick="editCmsCotentPic()"/>
				<@eu.linkbutton showName="刷新" shiro="cms:cmsCotentPic:refresh" iconCls="icon-reload" onclick="reloadCmsCotentPic()"/>
			</div>
		</div>
	</div>
</div>